]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
background: Don't prematurely remove file monitors
authorJasper St. Pierre <jstpierre@mecheye.net>
Thu, 12 Dec 2013 19:42:41 +0000 (14:42 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Fri, 13 Dec 2013 16:50:17 +0000 (11:50 -0500)
We need to only remove file monitors when there's no other users
of the content...

js/ui/background.js

index a56a0af8bbd3e4fbc5c03ddcf459fb360ec599ab..20a3a40303b7958e7395b34bde7322cfb73c9d05 100644 (file)
@@ -125,7 +125,8 @@ const BackgroundCache = new Lang.Class({
     removeImageContent: function(content) {
         let filename = content.get_filename();
 
-        if (filename && this._fileMonitors[filename])
+        let hasOtherUsers = this._images.some(function(content) { return filename == content.get_filename(); });
+        if (!hasOtherUsers)
             delete this._fileMonitors[filename];
 
         this._removeContent(this._images, content);